package io;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

/**
 * 使用对象输入流进行对象的反序列化*/
public class OISDemo {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("person.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);

        //Object obj = ois.readObject();
        Person p = (Person)ois.readObject();
        System.out.println(p);
        ois.close();
    }
}
